package com.spy.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.spy.system.mapper.DishCategoryMapper;
import com.spy.system.domain.DishCategory;
import com.spy.system.service.IDishCategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;
/**
 * 菜单类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-08
 */
@Service
public class DishCategoryServiceImpl extends ServiceImpl<DishCategoryMapper, DishCategory> implements IDishCategoryService
{
    @Autowired
    private DishCategoryMapper dishCategoryMapper;

    /**
     * 查询菜单类别
     * 
     * @param id 菜单类别主键
     * @return 菜单类别
     */
    @Override
    public DishCategory selectDishCategoryById(Long id)
    {
                return getById(id);
    }

    /**
     * 查询菜单类别列表
     * 
     * @param dishCategory 菜单类别
     * @return 菜单类别
     */
    @Override
    public List<DishCategory> selectDishCategoryList(DishCategory dishCategory)
    {
        return dishCategoryMapper.selectDishCategoryList(dishCategory);
    }

    /**
     * 新增菜单类别
     * 
     * @param dishCategory 菜单类别
     * @return 结果
     */
    @Override
    public int insertDishCategory(DishCategory dishCategory)
    {
                return save(dishCategory) ? 1 : 0;
    }

    /**
     * 修改菜单类别
     * 
     * @param dishCategory 菜单类别
     * @return 结果
     */
    @Override
    public int updateDishCategory(DishCategory dishCategory)
    {
                return updateById(dishCategory) ? 1 : 0;
    }

    /**
     * 批量删除菜单类别
     * 
     * @param ids 需要删除的菜单类别主键
     * @return 结果
     */
    @Override
    public int deleteDishCategoryByIds(Long[] ids)
    {
                return removeByIds(Arrays.asList(ids)) ? 1 : 0;
    }

    /**
     * 删除菜单类别信息
     * 
     * @param id 菜单类别主键
     * @return 结果
     */
    @Override
    public int deleteDishCategoryById(Long id)
    {
                return removeById(id) ? 1 : 0;
    }
}
